package net.mlike.openssp.server.entity.system;

import net.mlike.openssp.server.entity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Created by wallellen@hotmail.com on 5/24/18.
 */
@Entity
@Table(name = "t_sys_menu")
public class Menu extends BaseEntity {
    public enum Type {
        menu, button
    }

    private String name;

    @Enumerated(EnumType.STRING)
    private Type type;

    private String url;

    private String code;

    private String icon;

    @ManyToOne
    @JoinColumn(name = "parent_id")
    private Menu parent;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Menu getParent() {
        return parent;
    }

    public void setParent(Menu parent) {
        this.parent = parent;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }
}
